Enhanced Battery Monitor

Plasma 4 Extensions

Source i (link to git-repo or to original if based on someone elses unmodified work):

Add the source-code for this project on opencode.net

0
Become a Fan
7.8

Description:
This is the enhanced battery monitor that for now shows the battery's remaining time apart from the features in the default plasmoid.

EDIT: This plasmoid is no longer maintained.

Ratings & Comments

51 Comments

tnaker

i think there is a bug it cause the system to shutdow after showing a message that my battery is broken (%9) it only occur on kde

bigblondewolf

Hi The applet shows a blank battery with a red cross on the bottom right on my laptop. Everything else works fine: ac/batt status, percentage and time remaining, I just have a red cross on the battery. My battery is fine, holds for 5hrs. OS is Arch Linux, KDE should be 4.10 something, computer is Dell Latitude with a samsung extended battery. Btw the applet doesn't show battery model, the original one does.

bigblondewolf

Please disregard. Fixed after a system reboot

nekoxmachina

FYI: This is an embaracing bug in UPower. Please vote this up: https://bugs.freedesktop.org/show_bug.cgi?id=60214

Winnerer

If there is availability to translate this plasmoid to another languages? I can make Russian translation!

Myrmidon83

This doesn't seem to work. I have installed the plasmoid and checked the box which says 'show time' but it only shows the percentage, KDE 4.10.3. :( Is it something I have missed? Distro? KDE version?

Myrmidon83

Works now, didn't realise I had to click the icon, I thought hovering mouse over would show it. :P

arekm

Recent upower + solid from kde git recognizes other type of batteries like logitech wireless mouse/keyboard/trackball batteries. Unfortunatelly battery applet seems unable to deal with this type of batteries even with "show the state for each battery present" set. Could support for this be added? I guess "show the state for each battery present" should become "show the state for each battery type present" with such support. [arekm@t400 ~]$ solid-hardware details '/org/freedesktop/UPower/devices/mouse_0003o046DoC52Bx00BC' udi = '/org/freedesktop/UPower/devices/mouse_0003o046DoC52Bx00BC' parent = '/org/freedesktop/UPower' (string) vendor = 'Logitech, Inc.' (string) product = 'M570' (string) description = 'Unknown Battery' (string) Battery.plugged = true (bool) Battery.type = 'MouseBattery' (0x4) (enum) Battery.chargePercent = 50 (0x32) (int) Battery.rechargeable = true (bool) Battery.chargeState = 'Discharging' (0x2) (enum)

viranch

I don't have the keyboard/mouse with a battery to test it out. If the remaining time doesn't bother you, you can use the default battery plasmoid.

arekm

The default also doesn't support this.

EazyVG

Thanks a lot for this; I find it strange that estimated time is still not present in KDE 4.10!

EazyVG

BTW, I will be getting my second UltraBay battery (ThinkPad T430s) in about 2 weeks and will report back on the above issue in the posts.

EazyVG

Got my second UltraBay battery. With 2 batteries the applet correctly displays their presence but the time remaining is showed first for the UltraBay battery and once it has been exhausted then for the 2nd which is the main battery once it starts discharging. Anyways, showing total time for both is not of critical essence for me, and as I undesratnd it might be related with tp_smapi as the same is yet not fully supported (kernel 3.4.x openSUSE 12.2) on newer ThinkPad notebooks. Thanks again for the applet.

EazyVG

BTW, in case of charge state it correctly displays state of total, i.e. both the batteries.

cyberbeat

I made some modifications to show the remaining time also on the battery icon: diff -r enbattery/contents/ui/batterymonitor.qml ../../../../../Downloads/153981-enhanced-battery/contents/ui/batterymonitor.qml 52,53d51 < property int remainingMsec: Number(pmSource.data["Battery"]["Remaining msec"]) < 90d87 < property int remainingMsec: Number(pmSource.data["Battery"]["Remaining msec"]) 124c121 < text: show_remaining_time?formatDuration2(remainingMsec):i18nc("overlay on the battery, needs to be really tiny", "%1%", percent); --- > text: i18nc("overlay on the battery, needs to be really tiny", "%1%", percent); 241,254d237 < } < < function formatDuration2(msec) { < if (msec==0) < return ""; < < var time = new Date(msec); < var hours = time.getUTCHours(); < var minutes = time.getUTCMinutes(); < if (minutes<10) < minutes = "0"+minutes; < var str = hours+":"+minutes; < < return str;

viranch

your patch is a "reverse" one. you probably did- "diff your_plasmoid original_plasmoid" - which is wrong, you always do "diff old new", ie, "diff original_plasmoid your_plasmoid".

tomchiverton

I'd love to see this as an option, given the KDE developers feel they know better than their users and removed this feature (even as an option) https://bugs.kde.org/show_bug.cgi?id=304510

tomchiverton

Here is the patch updated for the latest release of this widget. Turn on 'show charge information' in the widget prefs to see the time remaining on the battery icon. $ diff -u batterymonitor.qml.orig batterymonitor.qml --- batterymonitor.qml.orig 2014-04-13 13:43:57.976169606 +0100 +++ batterymonitor.qml 2014-04-13 13:48:38.216181061 +0100 @@ -85,6 +85,7 @@ property bool hasBattery: view.singleBattery ? batteries.cumulativePluggedin : model["Plugged in"] property int percent: view.singleBattery ? batteries.cumulativePercent : model["Percent"] property bool pluggedIn: pmSource.data["AC Adapter"]["Plugged in"] + property int remainingMsec: Number(pmSource.data["Battery"]["Remaining msec"]) width: view.width/view.count height: view.height @@ -118,7 +119,7 @@ Text { id: overlayText - text: i18nc("overlay on the battery, needs to be really tiny", "%1%", percent); + text: show_remaining_time?formatDuration2(remainingMsec):i18nc("overlay on the battery, needs to be really tiny", "%1%", percent); color: theme.textColor font.pixelSize: Math.max(parent.size/8, 11) anchors.centerIn: labelRect @@ -236,4 +237,18 @@ } } } + function formatDuration2(msec) { + if (msec==0) + return ""; + + var time = new Date(msec); + var hours = time.getUTCHours(); + var minutes = time.getUTCMinutes(); + if (minutes<10) + minutes = "0"+minutes; + var str = hours+":"+minutes; + + return str; +} + }

claude0001

Hi viranch. Many thanks for making this non-official version available. I have a system (Lenovo T400) with two batteries. The Enhanced Battery Monitor correctly displays the total remaining time. However, it displays only the charge state of one battery, although two ("Battery0" and "Battery1") show up correctly as sources in Plasma Engine Explorer. The tooltip states e.g. "Battery: 93% (discharging)". Comparison with the information form Plasma Engine Explorer suggests that this corresponds to "Battery0". The information for "Battery1" is omitted. I'm running Ubuntu 12.04.1 with Kernel 3.2.0 (amd64) and KDE 4.9.2.

viranch

Did you set the "Show info for each battery" configuration option?

claude0001

"Show info for each battery" was already set. After some trying around I now believe that the problem is related to hibernation (aka. suspend-to-disk): Upon resume from hibernation, the plasmoid reproducibly "forgets" about one of the two batteries, although the information displayed by Plasma Engine Explorer is always correct. After a clean reboot both batteries show up again in the plasmoid. Sending the system to sleep (suspend-to-ram) does not seem to result in "loss" of one battery. All in all, the problem is less important than I first thought. Still, maybe things can be improved by somehow re-initialising the battery count upon resume ... ?

viranch

That's odd, does the official plasmoid have the same problem?

claude0001

At first sight, the situation with the official plasmoid seems to be worse: Right now I cannot get it to display both batteries ("show all batteries" is set of course) even after a clean boot. I will test further though ... I was using the official plasmoid on KDE 4.8.5 til yesterday, where it always worked as it should. I do not know if it ever worked properly on KDE 4.9.2 as I immediately switched to the unofficial plasmoid to get the remaining-time-feature back. Sorry for double posting btw. it seems to happen when Firefox refreshes the page after submission ...

viranch

The official plasmoid did not support multiple batteries for a couple of releases, but was fixed in 4.9.2. So please check if the official plasmoid in 4.9.2 works as expected. Since I don't have a computer with multiple batteries I can't test it myself.

claude0001

I now used both plasmoids side-by-side for one day. The official plasmoid consistently displays only one battery, no matter what I do. The unofficial plasmoid (which I downloaded using the "add new widget" function of KDE) mostly works as it should, i.e. displays total remaining time and charge states for two batteries. Only when I send the machine into hibernation it often (though not always) forgets one battery upon resume. Rebooting or cycling to sleep state and back then restores display of the second battery. The issue is not critical for me, but indicates that something is undeterminate with the battery count upon resuming from hibernation. The information shown by Plasma Engine Explorer has never been wrong up to now. I run KDE 4.9.2 installed from the Kubuntu-Backports repo. How can I tell if the version of the battery plasmoid packaged by the Kubuntu-devs is really the most recent upstream version?

Pling
0 Affiliates
Details
license
version 0.9.1
updated
added
downloads 24h 0
mediaviews 24h 0
pageviews 24h 2

Other Plasma 4 Extensions:

Icon Tasks deb build
N00bun2
last update date: 13 years ago

Score 4.3

Prayer Times Plasmoid
riyad
last update date: 13 years ago

Score 5.2

KPrayertime4 Islamic Prayer Times
ahaq
last update date: 15 years ago

Score 4.4

Hostinfo
mgraesslin
last update date: 13 years ago

Score 4.7

Monitor QuadCore Russian
kuchumovn
last update date: 16 years ago

Score 5.0

blaKjaK
werevire
last update date: 15 years ago

Score 5.0